import { buildService } from '../../helper/service'

// 值类型为String或Object,String为url(method),Object同axios(config)参数支持相同,data和params只能为对象类型
const settings = {
  // 项目文档库-列表
  getProjectFileTree: {
    url: '/api/v1/project/get_project_dir',
    method: 'get'
  },
  // 项目文档库-详情
  // 项目文档库-添加
  createFileTreeNode: {
    url: '/api/v1/project/get_project_dir',
    method: 'post'
  },
  // 项目文档库-编辑
  updateFileTreeNode: {
    url: '/api/v1/project/get_project_dir',
    method: 'put',
    type: 'restful'
  },
  // 项目文档库-删除
  deleteFileTreeNode: {
    url: '/api/v1/project/get_project_dir',
    method: 'delete',
    type: 'restful'
  },
  // 项目文档库-文件-列表
  getProjectFileList: {
    url: '/api/v1/project/get_project_doc_file',
    method: 'get'
  },
  // 项目文档库-文件-新增
  createProjectFile: {
    url: '/api/v1/project/get_project_doc_file',
    method: 'post'
  },
  // 项目文档库-文件-编辑
  updateProjectFile: {
    url: '/api/v1/project/get_project_doc_file',
    method: 'put',
    type: 'restful'
  },
  // 项目文档库-文件-删除
  deleteProjectFile: {
    url: '/api/v1/project/get_project_doc_file/delete',
    method: 'post'
  },
  // 标签-新增
  createTag: {
    url: '/api/v1/project/get_project_doc_file_sign',
    method: 'post'
  },
  // 标签-列表
  getTagList: {
    url: '/api/v1/project/get_project_doc_file_sign',
    method: 'get'
  },
  // 标签-删除
  deleteTag: {
    url: '/api/v1/project/get_project_doc_file_sign',
    method: 'delete',
    type: 'restful'
  },
  // 标签-从标签库添加到用户自己的标签列表
  editUserTagList: {
    url: '/api/v1/project/get_project_doc_file_sign/user',
    method: 'post'
  },
  // 标签-修改文件标签
  editFileTag: {
    url: '/api/v1/project/get_project_doc_file/sign',
    method: 'put',
    type: 'restful'
  },
  // 文档库树形-按项目
  getFileTree: {
    url: '/api/v1/project/dir_tree_by_project_ids',
    method: 'get'
  }
}

export default buildService(settings)
